import request from '@/utils/request'
/**
 *新增部门
 * @param {code,introduce,manager,name,pid} params
 * @returns
 */
export function addDepartment(data) {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}
/**
 *查询部门列表
 * @param {code,introduce,manager,name,pid} params
 * @returns
 */
export function getDepartment() {
  return request({
    url: '/company/department',
    method: 'get'

  })
}
/**
 *修改id部门详细
 * @param {code,introduce,manager,name,pid} params
 * @returns
 */
export function updateDepartment(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}
/**
 *根据id删除部门
 * @param {code,introduce,manager,name,pid} params
 * @returns
 */
export function delDepartment(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'

  })
}
/**
 *根据id查询部门详情
 * @param {id} params
 * @returns
 */
export function getDepartmentDatail(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'get'

  })
}
